require(['./config'], () =>{
    require(['header','footer'],()=>{
        class  Login{
            constructor(){
                this.sureLogin()
            }
            sureLogin (){
               $('#input_sureLogin').on('click',()=>{
                    let username = $('.input_username input').val(),
                        password = $('.input_password input').val(),
                        names = localStorage.getItem('name')
                        names = JSON.parse(names)
                     let sureBoolen =  names.some(function (name){
                           return name.username == username && name.password == password
                       })
                       console.log(sureBoolen)
                       if(sureBoolen){
                           let usersInfo = {username,password}
                           localStorage.setItem('usersInfo',JSON.stringify(usersInfo))
                           alert('欢迎您回家')
                           location.href = "/"
                       }else{
                        alert('请检查您的账号或密码')
                       }
                       

               })
            }


        }


        new Login





    })
})